#ssh-agent /bin/bash
#ssh-add ~/.ssh/id_rsa 
export HASTHI_HOME=`pwd`
cd $HASTHI_HOME

#SERVICE_COUNTS="200 400 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000"
#MANGER_COUNTS="2,1000 6,5000 11,6000 21,8000 51,15000"
#MANGER_COUNTS="10,10000 10,15000 10,20000 20,10000 20,15000 20,20000 40,10000 40,15000 60,10000"
#SERVICE_COUNTS="15000 10000"
#MANGER_COUNTS="10,20000 20 45 50,10100"
#SERVICE_COUNTS="19600"
#MANGER_COUNTS="20,20000"
#PAIRS="20,15000 10,15000 50,10000 20,10000 5,10000 20,18400 40,14000"
#PAIRS="10,15000 20,10000 5,10000 20,18400 40,14000"
#PAIRS="10,15000 5,15000"
#PAIRS="10,5000 10,10000"

#for p in ${PAIRS}; do
#	mc=`echo $p|cut -f1 -d','`
#	sc=`echo $p|cut -f2 -d','`
		
	$HASTHI_HOME/bootstrap.sh reset
	sleep 1s
	LOG_DIR=/u/hperera/logs/hasthi_${sc}X${mc}_`date +%m_%d_%H_%M`
	echo $LOG_DIR
	mkdir $LOG_DIR
	cmd1="srun -n 28 serviceset.sh 200 $LOG_DIR 0.0"
	cmd2="srun -N 4 testMngeNode.sh $HASTHI_HOME/hasthi.properties $HASTHI_HOME $LOG_DIR"
	echo $cmd1 $cmd2
	$cmd2 &
	sleep 40s
	$cmd1 &
	#srun -N 1 electiontest.sh 20 5000 50
	#Following wait for all child processes to complete 
	wait 
	echo $mc $sc "<" $maxsc " Done"
	mv hasthi*.log $LOG_DIR
	mkdir $LOG_DIR/tmp
	mv hasthi_job_* $LOG_DIR/tmp
	mv service*.log $LOG_DIR/tmp
#done 

